package com.suredy.base.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="V_E_UNIT")
public class Unit
{
  private String id;
  private String parentId;
  private String unitCode;
  private String unitName;
  private String unitNo;
  private String orgCode;
  private String orgName;
  private Set<User> userSet = new HashSet<User>();

  @Id
  public String getId() {
    return this.id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getParentId() {
    return this.parentId;
  }

  public void setParentId(String parentId) {
    this.parentId = parentId;
  }

  public String getUnitCode() {
    return this.unitCode;
  }

  public void setUnitCode(String unitCode) {
    this.unitCode = unitCode;
  }

  public String getUnitName() {
    return this.unitName;
  }

  public void setUnitName(String unitName) {
    this.unitName = unitName;
  }

  public String getUnitNo() {
    return this.unitNo;
  }

  public void setUnitNo(String unitNo) {
    this.unitNo = unitNo;
  }

  public String getOrgCode() {
    return this.orgCode;
  }

  public void setOrgCode(String orgCode) {
    this.orgCode = orgCode;
  }

  public String getOrgName() {
    return this.orgName;
  }

  public void setOrgName(String orgName) {
    this.orgName = orgName;
  }

  @OneToMany(mappedBy="unit", cascade={javax.persistence.CascadeType.ALL}, fetch=FetchType.LAZY)
  public Set<User> getUserSet() {
    return this.userSet;
  }

  public void setUserSet(Set<User> userSet) {
    this.userSet = userSet;
  }
}